package factory;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;
import java.io.InputStream;
import java.util.*;

/**
* bean工厂
*/
public class BeanFactory {
   //容器对象
   public static ApplicationContext applicationContext;

   //通过静态代码块为Properties对象赋值
   static {
       try {
           applicationContext = new ClassPathXmlApplicationContext("bean.xml");
       } catch (Exception e) {
           throw new ExceptionInInitializerError("初始化applicationContext失败");
      }
   }
}